package com.xhwl.logistics.service.impl;

import com.xhwl.logistics.bo.VehicleCarportBO;
import com.xhwl.logistics.bo.cent.VehicleIntegratedConfigBO;
import com.xhwl.logistics.bo.input.QueryVehicleCarportBO;
import com.xhwl.logistics.component.LookupVehicleParkingLotHandler;
import com.xhwl.logistics.service.IVehicleCarportService;
import com.xhwl.logistics.service.cent.QueryDeviceService;
import com.xhwl.logistics.strategy.IVehicleParkingLotHandler;
import org.springframework.beans.factory.annotation.Autowired;

//@Service
public class VehicleCarportServiceImpl implements IVehicleCarportService {

    @Autowired
    private QueryDeviceService queryDeviceService;

    @Autowired
    private LookupVehicleParkingLotHandler lookupVehicleParkingLotHandler;

    @Override
    public VehicleCarportBO queryCarport(QueryVehicleCarportBO queryVehicleCarportBO) {

        VehicleIntegratedConfigBO vehicleIntegratedConfigBO = queryDeviceService.queryIntegratedConfigFromProjectId(queryVehicleCarportBO.getProjectId());

        IVehicleParkingLotHandler vehicleParkingLotHandler = lookupVehicleParkingLotHandler.lookup(vehicleIntegratedConfigBO.getVehicleSystemInfoBO().getProductId());

        return vehicleParkingLotHandler.queryCarport(vehicleIntegratedConfigBO, queryVehicleCarportBO);
    }
}
